/*  
 * @(#) Tree.java Create on 2014-3-17 下午02:17:04   
 *   
 * Copyright 2014 by fibrlink.   
 */


package com.springdemo.basic.global.entity;

import java.util.List;
import java.util.Map;


/**
 * 树型结构实体类
 * @author charlin_yin
 * @date   2014-3-17
 */
public class Tree {
	
	private String id;
	private String text;
	private String state;
	private boolean checked;//复选框是否被选中
	private Map<String, Object> attributes;//想要其他属性可以放到这里
	private String type;
	private List<Tree> children;
	private String pid;
	public String getType() {
		return type;
	}
	public List<Tree> getChildren() {
		return children;
	}
	public void setChildren(List<Tree> children) {
		this.children = children;
	}
	public void setType(String type) {
		this.type = type;
	}
	public Map<String, Object> getAttributes() {
		return attributes;
	}
	public void setAttributes(Map<String, Object> attributes) {
		this.attributes = attributes;
	}
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getText() {
		return text;
	}
	public void setText(String text) {
		this.text = text;
	}
	public boolean isChecked() {
		return checked;
	}
	public void setChecked(boolean checked) {
		this.checked = checked;
	}
	

    public String getPid() {
		return pid;
	}
	public void setPid(String pid) {
		this.pid = pid;
	}
	@Override
    public boolean equals(Object o) {
        if (this == o){
            return true;
        }
        if (!(o instanceof Tree)){
            return false;
        }
        Tree tree = (Tree) o;

        if (!id.equals(tree.id)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        return id.hashCode();
    }
}
